<div class="rightbox">
	<h3><?php echo $this->translate->_("Pets"); ?></h3>
	<br />
	<?php echo $this->paginationControl($this->yourPets, 'Elastic', 'accounts/pets-controls.phtml', array('pos' => 'top')); ?>
	<div id="pin-container">
		<?php
		foreach($this->yourPets as $pet):
			$links = array();
			if ($this->auth->hasIdentity() && isset($pet["to_adopt"]) && intval($pet["to_adopt"]) == 1 && $this->auth->getIdentity()->id != $pet['user_id']):
				$links[] = array (
	    			'class' => 'adoptpet reqconf',
	    			'title' => $this->translate->_("Show interest for")." {$pet['name']}?",
	    			'url' => $this->url(array('controller'=>'adoption', 'action'=>'interest', 'pet' => $pet["id"]), 'default', true)
	    		);
			endif;
			echo $this->partial('pet-template.phtml', array(
	        	'translate' => $this->translate,
	        	'pet' => $pet,
				'sp' => ($this->identity && $this->identity->type == 2 && $pet['user_id'] != $this->identity->id),
	    		'allow' => true,
	    		'links' => $links
	    	));
		endforeach;
		?>
	</div>
	<div class="clear"></div>
	<?php echo $this->paginationControl($this->yourPets, 'Elastic', 'accounts/pets-controls.phtml', array('pos' => 'bot')); ?>
</div>
<?php include "../application/modules/frontend/views/scripts/plus.phtml"; ?>
<script type="text/javascript" src="<?php echo Petolio_Service_Util::autoVersion('/js/jquery/masonry.pkgd.min.js'); ?>"></script>
<script type="text/javascript">
	READY(function() {
		var $container = $('#pin-container');

		// initialize
		$container.masonry({
			itemSelector: '.pet-item',
			gutter: 7,
		});

		// redraw the layout after all the images were loaded
		$(window).load(function() {
			$container.masonry();
		});
	});
</script>
